package com.slkj.shilixiaoyuanapp.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.slkj.shilixiaoyuanapp.R;

/**
 * Created  on 2018-09-11
 *
 * @author 唐开阔
 * @describe
 */
public class DownFileDialog extends Dialog {
    ProgressBar progressBar;
    TextView textView;
    public DownFileDialog(@NonNull Context context) {
        super(context, R.style.normal_dialog);
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);//状态栏透明
        setContentView(R.layout.dialog_down_file);
        progressBar = findViewById(R.id.progressBar3);
        textView = findViewById(R.id.jindu);
        progressBar.setMax(100);
        setCancelable(false);
    }
    public void setProgress(@IntRange(from = 0,to = 100) int progress){
        progressBar.setProgress(progress);
        textView.setText(String.valueOf(progress));
    }
}
